package com.apartment;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Author : xuzhiyong
 * Date : 2022/5/27 17:27
 */
@SpringBootApplication
public class App implements WebMvcConfigurer {
    public static void main(String[] args) {
        SpringApplication.run(App.class,args);
        System.out.println("程序正在运行...");
    }
    //图片上传
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry){
        //imctemp-rainy只是想要映射路径而已，换成a,b,c都可以
        registry.addResourceHandler("/apartment/**").addResourceLocations("file:filePath=E:/JSP/Wokespace/apartmentRent/untitled/apartmentRent/src/main/resources/static/images/");
    }
}
